import { Button } from 'antd';
import { useParams, useSearchParams } from 'react-router-dom';

const Profile = () => {
  let params = useParams();
  const [searchParams, setSearchParams] = useSearchParams('a');
  return (
    <>
      <p> Profile id: {params.id}</p>
      <p>search all: {searchParams.getAll('a')}</p>
      <p>search: {searchParams.get('a')}</p>
      <Button onClick={() => setSearchParams({ a: `${Math.floor(Math.random() * 100)}` })}>setSearch</Button>
    </>
  );
};

export default Profile;
